﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VirtuOS.Components.Srvcs;
using System.Reflection;

namespace VirtuOS.Components
{
    class Services
    {
        public static List<string> Srvcs = new List<string>();

        public void Manager()
        {
            int uid = 0;
            Assembly assem = Assembly.GetExecutingAssembly();
            Type[] types = assem.GetTypes();
            foreach (Type t in types)
            {
                if (t.Namespace.Equals("VirtuOS.Components.Srvcs"))
                {
                    uid++;
                    string add = Convert.ToString(t.Name) + ":" + Convert.ToString(uid);
                    Srvcs.Add(add);
                    object instance = Activator.CreateInstance(t);
                    instance.GetType().InvokeMember("Load", BindingFlags.Public | BindingFlags.Static | BindingFlags.InvokeMethod, null, null, new object[] { });
                }
            }
        }
    }
}
